package dominion.player;

import dominion.Dominion;
import dominion.kingdom.Militia;
import dominion.kingdom.Thief;

public class MilitiaThiefPlayer extends TresureOnlyPlayer {

	Militia militia;
	Thief thief;

	public MilitiaThiefPlayer(Dominion dominion) {
		this("MilitiaThief", dominion);
	}

	public MilitiaThiefPlayer(String name, Dominion dominion) {
		super(name, dominion);
	}

	@Override
	public int buy(Dominion dominion, int value) {
		if (thief == null && 3 < value) {
			this.thief = new Thief();
			dominion.buy(this, this.thief);
		} else if (this.militia == null && 3 < value) {
			this.militia = new Militia();
			dominion.buy(this, this.militia);
		} else {
			super.buy(dominion, value);
		}
		return 0;
	}
}
